ihelpuoo.weboo.runtime.ActionDetail = function(a)
{
	this.action	= a;
	this.isAbstract	= false;
	this._extends = null;
	this.parentModuleName = null;
	this.parentActionName = null;
	this.typeName = null;
	this.comment = null;
	this.params = new Array();
	this.properties = new Array();
	this.HTML	= null;
}

ihelpuoo.weboo.runtime.ActionDetail.prototype
=
{
	valueOf: function(ele)
	{
		this.isAbstract = ("true" == ele.getAttribute("abstract"));
		this.typeName = ihelpuoo.xml.getElementText(ele,"type");
		this._extends = ele.getAttribute("extends");
		if(this._extends)
		{
			var pos = this._extends.indexOf(".");
			this.parentModuleName = this._extends.substring(0,pos);
			this.parentActionName = this._extends.substring(pos+1);
		}
		this.comment = ihelpuoo.xml.getElementText(ele,"comment");
		var es = ele.getElementsByTagName("params");
		if(es.length>0)
		{
			var eleParams = es[0].getElementsByTagName("param");
			for(var i=0;i<eleParams.length;i++)
			{
				var p = new ihelpuoo.weboo.runtime.ActionParam();
				p.valueOf(eleParams[i]);
				this.params.push(p);
			}
		}
		es = ele.getElementsByTagName("properties");
		if(es.length>0)
		{
			var eleProperties = es[0].getElementsByTagName("property");
			for(var i=0;i<eleProperties.length;i++)
			{
				var p = new ihelpuoo.weboo.runtime.ActionProperty();
				p.valueOf(eleProperties[i]);
				this.properties.push(p);
			}
		}
	}

	,
	render: function()
	{
		if(null==this.HTML)
		{
			this.HTML = new ihelpuoo.weboo.runtime.ActionDetailHTML();
			this.HTML.setAction(this.action);
			this.HTML.setTitle(this.action.name);
			this.HTML.setAncestores(this.getAncestores());
			this.HTML.setComment(this.comment);
			this.HTML.setType(this.isAbstract,this.typeName);
			for(var i=0;i<this.params.length;i++)
			{
				this.HTML.addParam(this.params[i]);
			}
			for(var i=0;i<this.properties.length;i++)
			{
				this.HTML.addProperty(this.properties[i]);
			}
		}
		this.HTML.show();
		return this.HTML.shell;
	}
	
	,
	getAncestores: function()
	{
		if(null==this._extends)return null;
		var rt = ihelpuoo.weboo.runtime.me();
		var pm = rt.getModule(this.parentModuleName);
		if(null==pm) return null;
		var pa = pm.getAction(this.parentActionName);
		if(null==pa) return null;
		var aas = pa.getDetail().getAncestores();
		if(null==aas)
			return new Array(pa);
		aas.push(pa);
		return aas;
	}
	
}